#!/usr/bin/env python
import flask
import base64
import requests

# Create the application.
APP = flask.Flask(__name__)
image_url = "http://192.168.0.154/capture"
@APP.route('/')
def index():
    file = requests.get("http://192.168.0.154/capture")
    #print(file.status_code)
    s = base64.b64encode(file.content)
    #print(s.decode('ascii'))
    return ("data:image/jpg;base64,"+s.decode('ascii'))

if __name__ == '__main__':
    APP.run()